﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="SharingCenter.Web.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    首页
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
<meta http-equiv ="Expire" Content ="0" runat="server" />
    <link href="Content/themes/redmond/home.css" rel="stylesheet" type="text/css" runat="server"
        id="Link1" />
        <style type="text/css">
            .sitemap{display:none;}
        </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Default.js" />
        </Scripts>
    </asp:ScriptManagerProxy>
    <div class="mw <%=User.Identity.IsAuthenticated?"au":"ua" %>">
        <div class="c1 left">
            <div>
                <asp:LoginView ID="LoginView1" runat="server">
                    <AnonymousTemplate>
                        <asp:Login ID="Login1" runat="server" OnLoggedIn="Login1_LoggedIn">
                            <LayoutTemplate>
                                <asp:Panel ID="Panel1" runat="server" DefaultButton="LoginButton">
                                    <h2 class="w5">
                                        登录</h2>
                                    <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse;">
                                        <tr>
                                            <td>
                                                <table border="0" cellpadding="0">
                                                    <tr>
                                                        <td align="right">
                                                            <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">帐号&nbsp;</asp:Label>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox CssClass="lgtxt" ID="UserName" runat="server"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                                                ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">
                                                            <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">密码&nbsp;</asp:Label>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="Password" CssClass="lgtxt" runat="server" TextMode="Password"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                                                ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                        </td>
                                                        <td>
                                                            <asp:CheckBox ID="RememberMe" runat="server" Text="下次自动登录" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                        </td>
                                                        <td>
                                                            <table cellpadding="0">
                                                                <tr>
                                                                    <td>
                                                                        <asp:LinkButton ID="LoginButton" CssClass="button loginbutton" runat="server" CommandName="Login"
                                                                            Text="登录" ValidationGroup="Login1" />
                                                                    </td>
                                                                    <td>
                                                                        &nbsp;
                                                                        <asp:HyperLink ID="HyperLink2" runat="server" CssClass="forgetpwd" NavigateUrl="~/Account/ResetPassword.aspx">忘记密码?</asp:HyperLink>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="center" colspan="2" style="color: Red;">
                                                            <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right" colspan="2">
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                            </LayoutTemplate>
                        </asp:Login>
                    </AnonymousTemplate>
                    <LoggedInTemplate>
                        <%-- <%=Profile.Personal.NickName %>
                        <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutText="[退出]" />--%>
                        <!-- Events start -->
                        <!-- Events end -->
                    </LoggedInTemplate>
                </asp:LoginView>
            </div>
        </div>
        <div class="c2">
            <div class="c21">
               <%-- <asp:LoginView runat="server">
                    <AnonymousTemplate>
                        <script type="text/javascript">
                            $(function () {
                                if (swfobject.hasFlashPlayerVersion("6.0.0")) {
                                    var fn = function () {
                                        var att = { data: "/Content/images/500x8020100813.swf", width: "500", height: "80" };
                                        var id = "homeami";
                                        var par = {};
                                        var myObject = swfobject.createSWF(att, par, id);
                                    };
                                    swfobject.addDomLoadEvent(fn);
                                }

                            });
                        </script>
                    </AnonymousTemplate>
                    <LoggedInTemplate>
                        <script type="text/javascript">
                            $(function () {
                                if (swfobject.hasFlashPlayerVersion("6.0.0")) {
                                    var fn = function () {
                                        var att = { data: "/Content/images/500x8020100813.swf", width: "540", height: "86.4" };
                                        var id = "homeami";
                                        var par = {};
                                        var myObject = swfobject.createSWF(att, par, id);
                                    };
                                    swfobject.addDomLoadEvent(fn);
                                }

                            });
                        </script>
                    </LoggedInTemplate>
                </asp:LoginView>
                <div id="homeami"></div>--%>
                <div class="ctn-p-t">
                    <h2 class="w5">
                        <span class="ns-calendar nss"></span><span class="iconlabel">热门活动</span></h2>
                    <asp:ListView ID="lvEvents" runat="server">
                        <LayoutTemplate>
                            <table class="tb-full">
                                <tr id="itemPlaceholder" runat="server">
                                </tr>
                            </table>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <tr class="trow">
                                <td class="tt">
                                    &#8226;
                                    <asp:HyperLink ID="HyperLink3" runat="server" Text='<%#Eval("Title") %>' NavigateUrl='<%#Eval("EventId", "~/Mod/Events/View.aspx?id={0}") %>'></asp:HyperLink>
                                </td>
                                <td>
                                    <cc:AvatarImage ID="AvatarImage1" CssClass="tinythumb" runat="server" AvatarType="Tiny"
                                        UserId='<%#Eval("CreatorUserId") %>' />
                                    <cc:NickNameLink ID="NickNameLink1" runat="server" UserId='<%#Eval("CreatorUserId") %>' />
                                </td>
                                <td align="right">
                                    <asp:Label ID="Label4" runat="server" Text='<%#Eval("StartDate", "{0:M月d日}开始") %>'></asp:Label>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <EmptyDataTemplate>
                            <span class="litetext">目前没有活动。</span>
                        </EmptyDataTemplate>
                    </asp:ListView>
                    <div class="actionarea textfar">
                        <asp:HyperLink runat="server" NavigateUrl="~/User/Events/">»所有活动</asp:HyperLink>&nbsp;
                        <%--<asp:HyperLink runat="server" NavigateUrl="~/User/Events/Event.aspx?a=c">»发起活动</asp:HyperLink>--%>
                    </div>
                </div>
                <div>
                    <h2 class="w5">
                        <span class="ns-reply nss"></span><span class="iconlabel">热门话题</span></h2>
                    <asp:ListView ID="lvThreads" runat="server">
                        <LayoutTemplate>
                            <div class="ctn-p-b">
                                <table class="tb-full">
                                    <tr id="itemPlaceholder" runat="server" />
                                </table>
                                
                            </div>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <tr class="trow">
                                <td class="tt">
                                    &#8226;
                                    <asp:HyperLink ID="MainPostIdLabel" runat="server" Text='<%# Eval("PostTitle") %>'
                                        NavigateUrl='<%#Eval("ThreadId", "~/Mod/Talks/Thread.aspx?t={0}&u=1") %>' />
                                </td>
                                <td>
                                    <cc:AvatarImage CssClass="tinythumb" runat="server" AvatarType="Tiny" UserId='<%#Eval("CreatorUserId") %>' />
                                    <cc:NickNameLink runat="server" UserId='<%#Eval("CreatorUserId") %>' />
                                </td>
                                <td align="right">
                                    <asp:Label ID="Label3" runat="server" Text='<%#Convert.ToInt32(Eval("TotalPosts"))-1 %>'></asp:Label>条回复
                                </td>
                            </tr>
                        </ItemTemplate>
                        <EmptyDataTemplate>
                            <span class="litetext">目前没有热门话题。</span>
                            
                        </EmptyDataTemplate>
                    </asp:ListView>
                    <div class="actionarea textfar">
                                    <asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="~/Mod/Talks/Default.aspx">»分享园区</asp:HyperLink>
                                </div>
                </div>
                <div>
                    <h2 class="w5">
                        <span class="ns-group nss"></span><span class="iconlabel">热门圈子</span></h2>
                    <div>
                        <myuc:GroupListBlock runat="server" ID="lvGroups" />
                        <div class="actionarea textfar">
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Mod/Groups/Default.aspx">»我的圈子</asp:HyperLink>
                        </div>
                    </div>
                </div>
            </div>
            <div class="c23">
                <div>
                    <h2 class="w5">
                        新成员</h2>
                    <asp:ListView ID="lvNewRegisters" runat="server" GroupItemCount="3">
                        <LayoutTemplate>
                            <table class="tb-full">
                                <tr runat="server" id="groupPlaceholder" />
                            </table>
                        </LayoutTemplate>
                        <GroupTemplate>
                            <tr>
                                <td runat="server" id="itemPlaceholder" />
                            </tr>
                        </GroupTemplate>
                        <ItemTemplate>
                            <td class="aitem" valign="top">
                                <span class="avtb" os="true"><span class="uid" title="<%#Eval("UserId") %>"></span>
                                </span>
                                <%--<myuc:ThumbAvatar runat="server" UserId='<%#Eval("UserId") %>' />--%>
                            </td>
                        </ItemTemplate>
                        <EmptyItemTemplate>
                            <td class="aitem">
                            </td>
                        </EmptyItemTemplate>
                    </asp:ListView>
                </div>
                <asp:LoginView ID="LoginView2" runat="server">
                    <LoggedInTemplate>
                        <div>
                            <h2 class="w5">
                                好友动态</h2>
                            <div class="se">
                                <myuc:SiteEventList ID="SiteEventList1" runat="server" DaySpan="-1" LimitCount="30"
                                    OnLoad="SiteEventList1_Load" />
                            </div>
                        </div>
                    </LoggedInTemplate>
                </asp:LoginView>
            </div>
            <div class="clear">
            </div>
        </div>
    </div>
</asp:Content>
